﻿namespace zyn_hy_login
{
    using System;
    using System.Management;

    public class GetHostInfo
    {
        public void HostCupinfo()
        {
        }

        public void HostHDinfo()
        {
        }

        public string z8System_Get_MacAddress()
        {
            string text = "";
            ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration");
            using (ManagementObjectCollection.ManagementObjectEnumerator enumerator = searcher.Get().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    //ati 2012.6.27
                    ManagementObject obj2 = new ManagementObject();// enumerator.get_Current();
                    //if (obj2.get_Item("IPEnabled").ToString() == "True")
                    //{
                    //    text = obj2.get_Item("MacAddress").ToString();
                    //}
                }
            }
            return text;
        }
    }
}

